﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using zhangmenren.IService;
using zhangmenren.Models;
using zhangmenren.Models.Enums;
using zhangmenren.Repository;

namespace zhangmenren.Service
{
    public class BannerService:IBannerService
    {

		private BannerRepository bannerRepository = new BannerRepository();


        public  Task<int> Add(BannerEntity banner)
        {
            return Task.FromResult(bannerRepository.Add(banner)) ;
        }

        public Task<int> Del(int id)
        {
            return Task.FromResult(bannerRepository.Del(id));
        }

        public Task<int> EditState(int id, bool state)
        {
            return Task.FromResult(bannerRepository.EditState(id,state));
        }

        public Task<IEnumerable<BannerEntity>> Find(BannerType type)
        {
            return Task.FromResult(bannerRepository.FindBanner(type));
        }

        public Task<IEnumerable<BannerEntity>> Selelct()
        {
            return Task.FromResult(bannerRepository.Select());
        }
    }
}
